\(\int \cot ^4(c+d x) \csc (c+d x) (a+a \sin (c+d x)) \, dx\) [373]

   Optimal result
   Rubi [A] (verified)
   Mathematica [C] (verified)
   Maple [A] (verified)
   Fricas [B] (verification not implemented)
   Sympy [F(-1)]
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 25, antiderivative size = 88 \[ \int \cot ^4(c+d x) \csc (c+d x) (a+a \sin (c+d x)) \, dx=a x-\frac {3 a \text {arctanh}(\cos (c+d x))}{8 d}+\frac {a \cot (c+d x)}{d}-\frac {a \cot ^3(c+d x)}{3 d}+\frac {3 a \cot (c+d x) \csc (c+d x)}{8 d}-\frac {a \cot ^3(c+d x) \csc (c+d x)}{4 d} \]

[Out]

a*x-3/8*a*arctanh(cos(d*x+c))/d+a*cot(d*x+c)/d-1/3*a*cot(d*x+c)^3/d+3/8*a*cot(d*x+c)*csc(d*x+c)/d-1/4*a*cot(d*
x+c)^3*csc(d*x+c)/d

Rubi [A] (verified)

Time = 0.10 (sec) , antiderivative size = 88, normalized size of antiderivative = 1.00, number of steps used = 7, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.200, Rules used = {2917, 2691, 3855, 3554, 8} \[ \int \cot ^4(c+d x) \csc (c+d x) (a+a \sin (c+d x)) \, dx=-\frac {3 a \text {arctanh}(\cos (c+d x))}{8 d}-\frac {a \cot ^3(c+d x)}{3 d}+\frac {a \cot (c+d x)}{d}-\frac {a \cot ^3(c+d x) \csc (c+d x)}{4 d}+\frac {3 a \cot (c+d x) \csc (c+d x)}{8 d}+a x \]

[In]

Int[Cot[c + d*x]^4*Csc[c + d*x]*(a + a*Sin[c + d*x]),x]

[Out]

a*x - (3*a*ArcTanh[Cos[c + d*x]])/(8*d) + (a*Cot[c + d*x])/d - (a*Cot[c + d*x]^3)/(3*d) + (3*a*Cot[c + d*x]*Cs
c[c + d*x])/(8*d) - (a*Cot[c + d*x]^3*Csc[c + d*x])/(4*d)

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rule 2691

Int[((a_.)*sec[(e_.) + (f_.)*(x_)])^(m_.)*((b_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Simp[b*(a*Sec[e +
 f*x])^m*((b*Tan[e + f*x])^(n - 1)/(f*(m + n - 1))), x] - Dist[b^2*((n - 1)/(m + n - 1)), Int[(a*Sec[e + f*x])
^m*(b*Tan[e + f*x])^(n - 2), x], x] /; FreeQ[{a, b, e, f, m}, x] && GtQ[n, 1] && NeQ[m + n - 1, 0] && Integers
Q[2*m, 2*n]

Rule 2917

Int[(cos[(e_.) + (f_.)*(x_)]*(g_.))^(p_)*((d_.)*sin[(e_.) + (f_.)*(x_)])^(n_.)*((a_) + (b_.)*sin[(e_.) + (f_.)
*(x_)]), x_Symbol] :> Dist[a, Int[(g*Cos[e + f*x])^p*(d*Sin[e + f*x])^n, x], x] + Dist[b/d, Int[(g*Cos[e + f*x
])^p*(d*Sin[e + f*x])^(n + 1), x], x] /; FreeQ[{a, b, d, e, f, g, n, p}, x]

Rule 3554

Int[((b_.)*tan[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Simp[b*((b*Tan[c + d*x])^(n - 1)/(d*(n - 1))), x] - Dis
t[b^2, Int[(b*Tan[c + d*x])^(n - 2), x], x] /; FreeQ[{b, c, d}, x] && GtQ[n, 1]

Rule 3855

Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-ArcTanh[Cos[c + d*x]]/d, x] /; FreeQ[{c, d}, x]

Rubi steps \begin{align*} \text {integral}& = a \int \cot ^4(c+d x) \, dx+a \int \cot ^4(c+d x) \csc (c+d x) \, dx \\ & = -\frac {a \cot ^3(c+d x)}{3 d}-\frac {a \cot ^3(c+d x) \csc (c+d x)}{4 d}-\frac {1}{4} (3 a) \int \cot ^2(c+d x) \csc (c+d x) \, dx-a \int \cot ^2(c+d x) \, dx \\ & = \frac {a \cot (c+d x)}{d}-\frac {a \cot ^3(c+d x)}{3 d}+\frac {3 a \cot (c+d x) \csc (c+d x)}{8 d}-\frac {a \cot ^3(c+d x) \csc (c+d x)}{4 d}+\frac {1}{8} (3 a) \int \csc (c+d x) \, dx+a \int 1 \, dx \\ & = a x-\frac {3 a \text {arctanh}(\cos (c+d x))}{8 d}+\frac {a \cot (c+d x)}{d}-\frac {a \cot ^3(c+d x)}{3 d}+\frac {3 a \cot (c+d x) \csc (c+d x)}{8 d}-\frac {a \cot ^3(c+d x) \csc (c+d x)}{4 d} \\ \end{align*}

Mathematica [C] (verified)

Result contains higher order function than in optimal. Order 5 vs. order 3 in optimal.

Time = 0.15 (sec) , antiderivative size = 153, normalized size of antiderivative = 1.74 \[ \int \cot ^4(c+d x) \csc (c+d x) (a+a \sin (c+d x)) \, dx=\frac {5 a \csc ^2\left (\frac {1}{2} (c+d x)\right )}{32 d}-\frac {a \csc ^4\left (\frac {1}{2} (c+d x)\right )}{64 d}-\frac {a \cot ^3(c+d x) \operatorname {Hypergeometric2F1}\left (-\frac {3}{2},1,-\frac {1}{2},-\tan ^2(c+d x)\right )}{3 d}-\frac {3 a \log \left (\cos \left (\frac {1}{2} (c+d x)\right )\right )}{8 d}+\frac {3 a \log \left (\sin \left (\frac {1}{2} (c+d x)\right )\right )}{8 d}-\frac {5 a \sec ^2\left (\frac {1}{2} (c+d x)\right )}{32 d}+\frac {a \sec ^4\left (\frac {1}{2} (c+d x)\right )}{64 d} \]

[In]

Integrate[Cot[c + d*x]^4*Csc[c + d*x]*(a + a*Sin[c + d*x]),x]

[Out]

(5*a*Csc[(c + d*x)/2]^2)/(32*d) - (a*Csc[(c + d*x)/2]^4)/(64*d) - (a*Cot[c + d*x]^3*Hypergeometric2F1[-3/2, 1,
 -1/2, -Tan[c + d*x]^2])/(3*d) - (3*a*Log[Cos[(c + d*x)/2]])/(8*d) + (3*a*Log[Sin[(c + d*x)/2]])/(8*d) - (5*a*
Sec[(c + d*x)/2]^2)/(32*d) + (a*Sec[(c + d*x)/2]^4)/(64*d)

Maple [A] (verified)

Time = 0.22 (sec) , antiderivative size = 104, normalized size of antiderivative = 1.18

method result size
derivativedivides \(\frac {a \left (-\frac {\left (\cot ^{3}\left (d x +c \right )\right )}{3}+\cot \left (d x +c \right )+d x +c \right )+a \left (-\frac {\cos ^{5}\left (d x +c \right )}{4 \sin \left (d x +c \right )^{4}}+\frac {\cos ^{5}\left (d x +c \right )}{8 \sin \left (d x +c \right )^{2}}+\frac {\left (\cos ^{3}\left (d x +c \right )\right )}{8}+\frac {3 \cos \left (d x +c \right )}{8}+\frac {3 \ln \left (\csc \left (d x +c \right )-\cot \left (d x +c \right )\right )}{8}\right )}{d}\) \(104\)
default \(\frac {a \left (-\frac {\left (\cot ^{3}\left (d x +c \right )\right )}{3}+\cot \left (d x +c \right )+d x +c \right )+a \left (-\frac {\cos ^{5}\left (d x +c \right )}{4 \sin \left (d x +c \right )^{4}}+\frac {\cos ^{5}\left (d x +c \right )}{8 \sin \left (d x +c \right )^{2}}+\frac {\left (\cos ^{3}\left (d x +c \right )\right )}{8}+\frac {3 \cos \left (d x +c \right )}{8}+\frac {3 \ln \left (\csc \left (d x +c \right )-\cot \left (d x +c \right )\right )}{8}\right )}{d}\) \(104\)
parallelrisch \(-\frac {a \left (3 \left (\cot ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-3 \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+8 \left (\cot ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-8 \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-24 \left (\cot ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+24 \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-192 d x -120 \cot \left (\frac {d x}{2}+\frac {c}{2}\right )+120 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )-72 \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )\right )}{192 d}\) \(124\)
risch \(a x -\frac {a \left (15 \,{\mathrm e}^{7 i \left (d x +c \right )}+9 \,{\mathrm e}^{5 i \left (d x +c \right )}-48 i {\mathrm e}^{6 i \left (d x +c \right )}+9 \,{\mathrm e}^{3 i \left (d x +c \right )}+96 i {\mathrm e}^{4 i \left (d x +c \right )}+15 \,{\mathrm e}^{i \left (d x +c \right )}-80 i {\mathrm e}^{2 i \left (d x +c \right )}+32 i\right )}{12 d \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right )^{4}}-\frac {3 a \ln \left ({\mathrm e}^{i \left (d x +c \right )}+1\right )}{8 d}+\frac {3 a \ln \left ({\mathrm e}^{i \left (d x +c \right )}-1\right )}{8 d}\) \(143\)
norman \(\frac {a x \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+a x \left (\tan ^{6}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-\frac {a}{64 d}-\frac {a \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{24 d}+\frac {7 a \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{64 d}+\frac {7 a \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{12 d}-\frac {7 a \left (\tan ^{7}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{12 d}-\frac {7 a \left (\tan ^{8}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{64 d}+\frac {a \left (\tan ^{9}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{24 d}+\frac {a \left (\tan ^{10}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{64 d}+\frac {a \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{4 d}}{\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{4} \left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}+\frac {3 a \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{8 d}\) \(214\)

[In]

int(cos(d*x+c)^4*csc(d*x+c)^5*(a+a*sin(d*x+c)),x,method=_RETURNVERBOSE)

[Out]

1/d*(a*(-1/3*cot(d*x+c)^3+cot(d*x+c)+d*x+c)+a*(-1/4/sin(d*x+c)^4*cos(d*x+c)^5+1/8/sin(d*x+c)^2*cos(d*x+c)^5+1/
8*cos(d*x+c)^3+3/8*cos(d*x+c)+3/8*ln(csc(d*x+c)-cot(d*x+c))))

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 180 vs. \(2 (80) = 160\).

Time = 0.27 (sec) , antiderivative size = 180, normalized size of antiderivative = 2.05 \[ \int \cot ^4(c+d x) \csc (c+d x) (a+a \sin (c+d x)) \, dx=\frac {48 \, a d x \cos \left (d x + c\right )^{4} - 96 \, a d x \cos \left (d x + c\right )^{2} - 30 \, a \cos \left (d x + c\right )^{3} + 48 \, a d x + 18 \, a \cos \left (d x + c\right ) - 9 \, {\left (a \cos \left (d x + c\right )^{4} - 2 \, a \cos \left (d x + c\right )^{2} + a\right )} \log \left (\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) + 9 \, {\left (a \cos \left (d x + c\right )^{4} - 2 \, a \cos \left (d x + c\right )^{2} + a\right )} \log \left (-\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) - 16 \, {\left (4 \, a \cos \left (d x + c\right )^{3} - 3 \, a \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )}{48 \, {\left (d \cos \left (d x + c\right )^{4} - 2 \, d \cos \left (d x + c\right )^{2} + d\right )}} \]

[In]

integrate(cos(d*x+c)^4*csc(d*x+c)^5*(a+a*sin(d*x+c)),x, algorithm="fricas")

[Out]

1/48*(48*a*d*x*cos(d*x + c)^4 - 96*a*d*x*cos(d*x + c)^2 - 30*a*cos(d*x + c)^3 + 48*a*d*x + 18*a*cos(d*x + c) -
 9*(a*cos(d*x + c)^4 - 2*a*cos(d*x + c)^2 + a)*log(1/2*cos(d*x + c) + 1/2) + 9*(a*cos(d*x + c)^4 - 2*a*cos(d*x
 + c)^2 + a)*log(-1/2*cos(d*x + c) + 1/2) - 16*(4*a*cos(d*x + c)^3 - 3*a*cos(d*x + c))*sin(d*x + c))/(d*cos(d*
x + c)^4 - 2*d*cos(d*x + c)^2 + d)

Sympy [F(-1)]

Timed out. \[ \int \cot ^4(c+d x) \csc (c+d x) (a+a \sin (c+d x)) \, dx=\text {Timed out} \]

[In]

integrate(cos(d*x+c)**4*csc(d*x+c)**5*(a+a*sin(d*x+c)),x)

[Out]

Timed out

Maxima [A] (verification not implemented)

none

Time = 0.29 (sec) , antiderivative size = 107, normalized size of antiderivative = 1.22 \[ \int \cot ^4(c+d x) \csc (c+d x) (a+a \sin (c+d x)) \, dx=\frac {16 \, {\left (3 \, d x + 3 \, c + \frac {3 \, \tan \left (d x + c\right )^{2} - 1}{\tan \left (d x + c\right )^{3}}\right )} a - 3 \, a {\left (\frac {2 \, {\left (5 \, \cos \left (d x + c\right )^{3} - 3 \, \cos \left (d x + c\right )\right )}}{\cos \left (d x + c\right )^{4} - 2 \, \cos \left (d x + c\right )^{2} + 1} + 3 \, \log \left (\cos \left (d x + c\right ) + 1\right ) - 3 \, \log \left (\cos \left (d x + c\right ) - 1\right )\right )}}{48 \, d} \]

[In]

integrate(cos(d*x+c)^4*csc(d*x+c)^5*(a+a*sin(d*x+c)),x, algorithm="maxima")

[Out]

1/48*(16*(3*d*x + 3*c + (3*tan(d*x + c)^2 - 1)/tan(d*x + c)^3)*a - 3*a*(2*(5*cos(d*x + c)^3 - 3*cos(d*x + c))/
(cos(d*x + c)^4 - 2*cos(d*x + c)^2 + 1) + 3*log(cos(d*x + c) + 1) - 3*log(cos(d*x + c) - 1)))/d

Giac [A] (verification not implemented)

none

Time = 0.36 (sec) , antiderivative size = 153, normalized size of antiderivative = 1.74 \[ \int \cot ^4(c+d x) \csc (c+d x) (a+a \sin (c+d x)) \, dx=\frac {3 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} + 8 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 24 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 192 \, {\left (d x + c\right )} a + 72 \, a \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) \right |}\right ) - 120 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - \frac {150 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} - 120 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 24 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 8 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 3 \, a}{\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4}}}{192 \, d} \]

[In]

integrate(cos(d*x+c)^4*csc(d*x+c)^5*(a+a*sin(d*x+c)),x, algorithm="giac")

[Out]

1/192*(3*a*tan(1/2*d*x + 1/2*c)^4 + 8*a*tan(1/2*d*x + 1/2*c)^3 - 24*a*tan(1/2*d*x + 1/2*c)^2 + 192*(d*x + c)*a
 + 72*a*log(abs(tan(1/2*d*x + 1/2*c))) - 120*a*tan(1/2*d*x + 1/2*c) - (150*a*tan(1/2*d*x + 1/2*c)^4 - 120*a*ta
n(1/2*d*x + 1/2*c)^3 - 24*a*tan(1/2*d*x + 1/2*c)^2 + 8*a*tan(1/2*d*x + 1/2*c) + 3*a)/tan(1/2*d*x + 1/2*c)^4)/d

Mupad [B] (verification not implemented)

Time = 9.80 (sec) , antiderivative size = 217, normalized size of antiderivative = 2.47 \[ \int \cot ^4(c+d x) \csc (c+d x) (a+a \sin (c+d x)) \, dx=\frac {2\,a\,\mathrm {atan}\left (\frac {8\,\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )+3\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{3\,\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )-8\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d}+\frac {3\,a\,\ln \left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{8\,d}+\frac {5\,a\,\mathrm {cot}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{8\,d}-\frac {5\,a\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{8\,d}+\frac {a\,{\mathrm {cot}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2}{8\,d}-\frac {a\,{\mathrm {cot}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3}{24\,d}-\frac {a\,{\mathrm {cot}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4}{64\,d}-\frac {a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2}{8\,d}+\frac {a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3}{24\,d}+\frac {a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4}{64\,d} \]

[In]

int((cos(c + d*x)^4*(a + a*sin(c + d*x)))/sin(c + d*x)^5,x)

[Out]

(2*a*atan((8*cos(c/2 + (d*x)/2) + 3*sin(c/2 + (d*x)/2))/(3*cos(c/2 + (d*x)/2) - 8*sin(c/2 + (d*x)/2))))/d + (3
*a*log(sin(c/2 + (d*x)/2)/cos(c/2 + (d*x)/2)))/(8*d) + (5*a*cot(c/2 + (d*x)/2))/(8*d) - (5*a*tan(c/2 + (d*x)/2
))/(8*d) + (a*cot(c/2 + (d*x)/2)^2)/(8*d) - (a*cot(c/2 + (d*x)/2)^3)/(24*d) - (a*cot(c/2 + (d*x)/2)^4)/(64*d)
- (a*tan(c/2 + (d*x)/2)^2)/(8*d) + (a*tan(c/2 + (d*x)/2)^3)/(24*d) + (a*tan(c/2 + (d*x)/2)^4)/(64*d)